import {post,get} from './axios_hd'

//获取token
export function getTokenApi(params:{}) { 
    return new Promise((resolve,reject)=>{
        post('/blackHole3D/basic/account/getToken',params).then((data)=>{
            resolve(data);
        }).catch((error)=>{
            reject(error)
        })
    })
}

// 查询数据集文件根目录
export function getDataSetRootNodesData(params:{}) { 
    return new Promise((resolve,reject)=>{
        post('/blackHole3D/project/dataSet/dataSetRootNodes',params).then((data)=>{
            resolve(data);
        }).catch((error)=>{
            reject(error)
        })
    })
}

// 查询数据集每个文件目录树
export function getDataSetFileTreeNodesData(params:{}) { 
    return new Promise((resolve,reject)=>{
        post('/blackHole3D/project/dataSet/dataSetFileTreeNodes',params).then((data)=>{
            resolve(data);
        }).catch((error)=>{
            reject(error)
        })
    })
}

// 按构件Id查询属性
export function getElementParamData(params:{}) { 
    return new Promise((resolve,reject)=>{
        post('/blackHole3D/project/element/getElementParam',params).then((data)=>{
            resolve(data);
        }).catch((error)=>{
            reject(error)
        })
    })
}

// 按构件Id查询属性
export function getElementParamV3(params:{}) { 
    return new Promise((resolve,reject)=>{
        post('/blackHole3D/project/element/v3/getElementParam',params).then((data)=>{
            resolve(data);
        }).catch((error)=>{
            reject(error)
        })
    })
}

// 请求树目录节点下的构件Id
export function getTreeChildrenData(params:{}) { 
    return new Promise((resolve,reject)=>{
        post('/blackHole3D/project/element/getTreeChildren',params).then((data)=>{
            resolve(data);
        }).catch((error)=>{
            reject(error)
        })
    })
}

// 属性搜索
export function getElementsByParamsPaging(params:{}) { 
    return new Promise((resolve,reject)=>{
        post('/blackHole3D/project/element/getElementsByParamsPaging',params).then((data)=>{
            resolve(data);
        }).catch((error)=>{
            reject(error)
        })
    })
}

// 属性搜索2
export function getElementIdByParamNamePaging(params:{}) { 
    return new Promise((resolve,reject)=>{
        post('/blackHole3D/project/element/v3/getElementIdByParamNamePaging',params).then((data)=>{
            resolve(data);
        }).catch((error)=>{
            reject(error)
        })
    })
}

